

(function($){
	$.openConfirmAlert = function(title,content,callFun){
	   var aDom = $("<a href='#mySysConfirmModal_' data-toggle='modal' ></a>");
       var confirmAlertDom = $( "<div class='modal fade' id='mySysConfirmModal_' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true' style='display: none;'>"+
						        "    <div class='modal-dialog'>"+
						        "        <div class='modal-content'>"+
						        "            <div class='modal-header'>"+
						        "                <button type='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button>"+
						        "                <h4 class='modal-title'>"+title+"</h4>"+
						        "            </div>"+
						        "            <div class='modal-body'>"+
						        				content+
						        "            </div>"+
						        "            <div class='modal-footer'>"+
						        "                <button data-dismiss='modal' class='btn btn-default' type='button'>关闭</button>"+
						        "                <button class='btn btn-warning' type='button' id='confirmAlertBtn_'> 确认</button>"+
						        "            </div>"+
						        "        </div>"+
						        "    </div>"+
						        "</div>");
       
       var existsAlertDom = $("body").find("div[id='mySysConfirmModal_']");
       if(existsAlertDom.length == 0){
    	   confirmAlertDom.find("button[id='confirmAlertBtn_']").click(function(){
    		   if(typeof callFun == "function"){
    			   new callFun;
	  	       }else if(typeof callFun == "string"){
	  	    	 eval(callFun);
	  	       }
   			  $("#mySysConfirmModal_").modal('hide');
   		   });
    	   
    	   $(confirmAlertDom).appendTo("body");
       }
       $(aDom).appendTo("body");
       $(aDom).click();
       $(aDom).remove();
	};
})(jQuery);